{assign $move false}

{block #treeView}
<table class="invisibletable2"{if $move} style="position:relative;left:10px;"{/if}>
    {foreach $parents as $child}
    <tr>
        <td style="padding:0px 10px 0px 10px;">{$child->name} <span title="{!_'Number of memebers'}">({$child->members})</span></td>
        <td><a href="{plink Roles:add, $child->id}" class="button ui-state-default ui-corner-all" title="{!_'Add child role'}"><span class="ui-icon ui-icon-plus">{!_"add"}</span></a></td>
        <td><a href="{plink Roles:edit, $child->id}" class="button ui-state-default ui-corner-all" title="{!_'Edit role'}"><span class="ui-icon ui-icon-wrench">{!_"edit"}</span></a></td>
        <td><a href="{plink Roles:users, $child->id}" class="button ui-state-default ui-corner-all" title="{!_'Show users'}"><span class="ui-icon ui-icon-person">{!_"users"}</span></a></td>
        <td><a href="{plink Roles:access, $child->id}" class="button ui-state-default ui-corner-all" title="{!_'Edit access control list'}"><span class="ui-icon ui-icon-locked">{!_"acl"}</span></a></td>
        <td><a href="{plink Roles:delete, $child->id}" class="button ui-state-default ui-corner-all" title="{!_'Delete role'}"><span class="ui-icon ui-icon-trash">{!_"delete"}</span></a></td>
    </tr>
    {if $nodes->hasChildNodes($child->id)}
        {assign $move true}
        <tr><td colspan="6">{include #treeView, 'parents' => $nodes->getChildNodes($child->id), 'move' => $move}</td></tr>
    {else}
        {assign $move false}
    {/if}
    {/foreach}
</table>
{/block}